<template>
	<!-- 系统消息 -->
	<view class="">
		<view class="" style="margin:20rpx;padding:35rpx 0;background-color: #fff;"
			v-for="(item, index) in SystemMessage" :key="index">
			<view class="" style="font-size: 30rpx;padding:0 35rpx;">
				{{ item.SystemMessageTitle }}
			</view>
			<view class="" style="font-size: 24rpx; color:#d8d8d8;margin-top: 10rpx;padding:0 35rpx;">
				<!-- 17小时前 -->
				{{ $common.timeDiff( item.addTime , new Date()) }}
			</view>
			<view class="" style="font-size: 28rpx;padding:20rpx 35rpx;color:#d1d1d1;">
				<text v-if="item.SystemMessageState == 2">审核未通过的原因：</text>
				<text> {{ item.SystemMessageDesc }} </text>
			</view>
			<view class=""
				style="border-top: 1rpx solid #f0f0f0;display: flex;flex-direction: row;justify-content: space-between;align-items: center;padding:0 35rpx;padding-top: 20rpx;"
				@click="onNav(item.Type)">
				<text style="font-size: 28rpx;" v-if="item.Type == 1">查看我的通告</text>
				<text style="font-size: 28rpx;" v-if="item.Type == 2">查看我的约单</text>
				<text style="font-size: 28rpx;" v-if="item.Type == 3">查看我的极速联系</text>
				<uni-icons type="forward" size="16" color="#d6d6d6"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				SystemMessage: [],
			}
		},
		onLoad() {
			this.getSystemMessageList()
		},
		methods: {
			getSystemMessageList() {
				this.$httpost('/system/index', {}).then(res => {
					// console.log('系统消息', res)
					if (res.code == 200) this.SystemMessage = res.data;
				})
			},
			onNav(isType) {
				let url = ''
				if (isType == 1) url = '/myPages/pages/myTonggao'
				if (isType == 2) url = '/myPages/pages/myYuedan'
				if (isType == 3) url = '/myPages/pages/myReceiveContact'

				uni.navigateTo({
					url
				})
			},
		}
	}
</script>

<style>
</style>